<?php if(!defined('IN_PISCES')){exit('Access Denied.');}?>



<div class="square-wrap clearfix">
	<div class="w990">
				<!-- 轮播 -->

{AdList 'list_top'}
<div class="slide">
	<div class="loading" id="J_Slide">
		<ol class="ks-switchable-content">
		{AdItem}
		{$lv['code']}
		{/AdItem}
		</ol>
		<ul class="ks-switchable-nav">
		{AdItem}
		<li{if $k==0} class="ks-active"{/if}>{$k+1}</li>
		{/AdItem}
		</ul>
	</div>
</div>
{/AdList}

		<!---列表 start---->
		<div class="result-list-wrapper">
			<div  class="result-box infinite_scroll" >
			
			
			<!-- 第一列 -->
			
			<!--{loop $columns $key $item}-->
						<div id="I_{$key}" class="result-item masonry_brick">
    					<div class="result-item-wrap" >
	        				<div class="result-item-bd">
	        					<div class="pic-brief">
									<div class="wow-pic-bd">
										<p class="price-view"><strong><s></s>{$item['price']}</strong></p>
										<a target="_blank" href="{url('Share','View',array('id'=>$item['id']))}"><img width="210" alt="" src="{$item['pic']}"></a>
	        						</div>
	        						<div class="wow-info-view clearfix">
	        							<div class="vote-area">
	        									<div class="wow-dig">
													<a href="javascript:void(0);" data-shareid="{$item['share_id']}" class="vote-trigger SHARE_FAV_A">喜欢</a>
													<span class="J_Counter" id="SHARE_FAV_COUNT_{$item['share_id']}">{$item['collect_num']}</span>
											    </div>
	        							</div>
										<p class="fxer-count">
											<a target="_blank" href="{url('Share','View',array('id'=>0))}">{$item['share_num']}人购后分享</a>
										</p>
	        						</div>
	        					</div>
		        					<div  class="fx-brief">
		        					
		        							<div class="fxer-archive">
		        							<a class="fxer-avatar" target="_blank" href="{if $item['user_id']>0}{url('User','Index',array('uid'=>$item['user_id']))}{else}javascript:void(0){/if}"><img width="30" height="30" alt="" src="{$item['logo']}"></a>
		        							<dl>
		        								<dt><a  {if $item['user_id']>0}href="{url('User','Index',array('uid'=>$item['user_id']))}"  target="_blank"{else}href="javascript:void(0)"{/if}>{$item['username']}</a></dt>
		        								<dd>{$item['created']}&nbsp;&nbsp;分享</dd>
		        							</dl>
		        							</div>
		        							<div class="fx-cnt-bd clearfix">
		        							<p class="fx-txts"><a target="_blank" href="{url('Share','View',array('id'=>$item['id']))}"> {CnTruncate $item['content'],45,'...'} </a></p>
		        							</div>
		        					</div>
	        				</div>
						</div>

					  </div>
			  <!--{/loop}-->
			  
			  
			<div class="list-pagination">
				<div id="J_pagiNator">
					{$this->data['pages']}
				</div>
			</div>
			<div style="padding:10px 0">
			{AdList 'list_bottom'}
			{AdItem}
			{$lv['code']}
			{/AdItem}
			{/AdList}
			</div>
		</div>
	</div>
	<!---列表 end---->
	
<div id="tests"></div>
<script>
$(function(){
	doSlide('J_Slide');
	function masonry(){ 
		$('.item img').load(function(){ 
			$('.infinite_scroll').masonry({ 
				itemSelector: '.masonry_brick',
				columnWidth:240,
				gutterWidth:10
			});	
		});	
		$('.infinite_scroll').masonry({ 
			itemSelector: '.masonry_brick',
			columnWidth:240,
			gutterWidth:10
		});	
	}
	masonry();
	$('.item').fadeIn();
	
	
	var sp = 1
	//console.log(typeof $(".infinite_scroll").infinitescroll);
    $(".infinite_scroll").infinitescroll({
        navSelector  	: "#more",
        nextSelector 	: "#more a",
        itemSelector 	: ".item",
        //bufferPx: -200,
        loading: {
            img: def.root+"statics/images/masonry_loading.gif",
            msgText: "加载更多商品",
            finishedMsg: '',
            finished: function(){
                sp++;
				//console.log(sp);
                if(sp>=def.waterfall_sp){
                    $("#more").remove();
                    $("#infscr-loading").hide();
                    $("#page").show();
                    $(window).unbind('.infscr');
                }
            }
        }
    }, function(newElements){
        var $newElems = $(newElements);
        $('.infinite_scroll').masonry('appended', $newElems, false);
        $newElems.fadeIn();
		item_callback();
		return;
        $newElems.find('.img img').lazyload({
            threshold:300,
            effect:"fadeIn",
            placeholder:def.root+"statics/images/grey.gif"
        }); 
    });
	
});
</script>